local tArgs = {...}

if #tArgs >= 1 then
 path = shell.resolve(tArgs[1])
 if fs.isReadOnly(path) and not security.getSU() then
  -- prevent users from seeing unauthorized code
  -- they should only be able to see their own files and ones in /var/log
  exception.throw("SecurityException", path)
  return
 end
 if not fs.exists(path) or fs.isDir(path) then
  gui.printAppInfo("cat", "file does not exist")
 else
  textutils.pagedPrint(kernel.printFile(path))
 end
else
 gui.printAppInfo("cat", "filename not specified")
end
